#include "QLogger.h"
#include <QDateTime>

QLogger* QLogger::instance = NULL;

QLogger::QLogger(QWidget *parent)
	: QWidget(parent)
{
	ui.setupUi(this);
}

QLogger::~QLogger()
{

}

void QLogger::append( const QString &msg )
{
	const QString dateTime = "[" + QDateTime::currentDateTime().toString() + "]";
	ui.textBrowser->append( dateTime + msg );
}

QLogger* QLogger::getInstance()
{
	if( instance == NULL ){
		instance = new QLogger(NULL);
	}
	return instance;
}


